package cn.aws360.boot.auth.api.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author junnan
 */
@Getter
@AllArgsConstructor
public enum LoginTypeEnum {

    /**
     * 密码登录
     */
    PWD("密码登录", "PWD"),

    /**
     * 短信登录
     */
    SMS("短信登录", "SMS"),

    /**
     * 第三方登录
     */
    TPS("第三方登录", "TPS"),

    ;

    private final String label;
    private final String value;

    public static LoginTypeEnum getLoginEnum(String option) {
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if (loginTypeEnum.getValue().equalsIgnoreCase(option)) {
                return loginTypeEnum;
            }
        }
        return null;
    }

}
